#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include <QMessageBox>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);



    connect(ui->btn1,&QPushButton::clicked,this,[&](){

        num = num + 100;

        qDebug() << "btn1:" << num << Qt::endl;
    });




    connect(ui->btn2,&QPushButton::clicked,this,[&](){

        num = num + 100;

        qDebug() << "btn2:" << num << Qt::endl;
    });


    connect(ui->btn3,&QPushButton::clicked,this,[=](){

        num = num + 100;

        qDebug() << "btn3:" << num << Qt::endl;
    });



    int let = [=]()->int{return ++num;}();
    qDebug() << let << Qt::endl;




}

MainWindow::~MainWindow()
{
    delete ui;
}
